{% extends 'blogs/common/base.html' %}

{% block content %}
    <div class="layui-container">
        <div class="layui-row layui-col-space15">
            {# 中心区内容 #}
            <div class="layui-col-md9">
                {% for article in article_pg %}
                    <div class="post-card">
                        <h2>
                            <a style="color: #227eaa;" href="{{ url_for('blogs.article', article_id=article.id) }}">{{ article.title }}</a>
                        </h2>
                        <div class="clamp-text">{{ article.content_html | remove_html_tags }}</div>
                        <div class="post-msg">
                        <span>
                            <i class="layui-icon">&#xe612;</i>
                            <span class="author">{{article.user.username}}</span>
                        </span>
                            <span>
                            <i class="layui-icon">&#xe705;</i>
                            <a href="#" class="category">{{ article.category.name }}</a>
                        </span>
                            <span>
                            <i class="layui-icon">&#xe68d;</i>
                            <span class="post-info">{{ article.add_time | strftime_comment }}</span>
                        </span>
                            <span>
                            <i class="layui-icon">&#xe62c;</i>
                            <span class="post-info">{{ article.read_count }}</span>
                        </span>
                            <span>
                            <a href="{{ url_for('blogs.article', article_id=article.id) }}" class="detail">阅读全文</a>
                        </span>
                        </div>
                    </div>
                {% endfor %}
                <div id="demo-laypage-theme-1"></div>

            </div>

            {# 右边侧边栏 #}
            <div class="layui-col-md3">
                <div style="height:800px; width: 100%;">
                    {% include 'blogs/common/sidebar.html' %}
                </div>
            </div>
        </div>
    </div>
{% endblock %}